<!DOCTYPE html>
<html>
<head>
    <title>维护库</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 100%;
            float: right;
        }
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
        .leftHeight{
            height: 85vh;
            overflow: auto;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
        .workShops{
            position: absolute;
            top: 0;
            width: 100%;
            height: 25px;
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="选项名称"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.code" @on-enter="query" placeholder="选项编码"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.devSupplyName" @on-enter="query" placeholder="供应厂家"></i-input>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.freRate" placeholder="实施频率">
                        <i-option v-for="item in freRateArray" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.mainType" placeholder="规程类型">
                        <i-option v-for="item in mainTypeList" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("devmainbase:import"))
                <i-button type="info" @click="exportData"><i class="fa fa-hand-o-up"></i>&nbsp;预防性导出</i-button>
                <Upload ref="uploadFile"
                        action="../devmainbase/importPM"
                        :format="['xlsx','xls']"
                        :show-upload-list="false"
                        :before-upload="handleBeforeUpload"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;预防性导入</i-button>
                </Upload>
                <Upload ref="uploadFile"
                        action="../devmainbase/importPDM"
                        :format="['xlsx','xls']"
                        :show-upload-list="false"
                        :before-upload="handleBeforeUpload"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;预测性导入</i-button>
                </Upload>
                #end
                #if($shiro.hasPermission("devmainbase:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("devmainbase:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("devmainbase:switchFlag"))
                <i-button type="success" @click="switchFlag('on')"><i class="fa fa-unlock"></i>&nbsp;启用</i-button>
                <i-button type="warning" @click="switchFlag('off')"><i class="fa fa-lock"></i>&nbsp;禁用</i-button>
                #end
                #if($shiro.hasPermission("devmainbase:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end

                <!--<Upload ref="uploadFile"
                        action="../devmainbase/import"
                        :format="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>-->

            </div>
        </Row>
        <Row  :gutter="16" style="margin: 8px 0px 0px 1px;">
            <i-col :xs="3" :sm="3" :md="3" :lg="3">
                <div class="leftHeight" >
                    <div class="workShops">
                        <p class="text-center" style="font-size: 15px;">设备类型</p>
                    </div>
                    <div id="devTypeLayer" style="margin-top: 25px">
                        <ul id="devTypeTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="21" :sm="21" :md="21" :lg="21">
                <table  id="jqGrid"></table>
            </i-col>
        </Row>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="devMainBase" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="维护类型" prop="mainType">
                        <i-select v-model="devMainBase.mainType" placeholder="维护类型">
                            <i-option v-for="item in mainTypeList" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="维护属性" prop="attribute">
                        <i-select v-model="devMainBase.attribute" placeholder="维护类型">
                            <i-option v-for="item in attributeList" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="选项名称" prop="name">
                        <i-input v-model="devMainBase.name" placeholder="选项名称"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="设备状态" prop="devStatus">
                        <i-select v-model="devMainBase.devStatus" placeholder="设备状态">
                            <i-option v-for="item in devStatusList" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="实施频率" prop="freRate">
                        <i-select v-model="devMainBase.freRate" placeholder="实施频率"  >
                            <i-option v-for="item in freRateArray" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="人次" prop="perEv">
                        <i-input v-model="devMainBase.perEv" placeholder="人次" type="number"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="供应厂家" prop="devSupply">
                        <i-input v-model="devMainBase.devSupplyName" placeholder="供应厂家" icon="md-arrow-dropdown-circle" @on-click="loadFacType" readonly></i-input>
                        <i-input v-model="devMainBase.devSupply" v-show="false"></i-input>
                    </Form-item>
                </i-col>
                <input type="hidden" v-model="devMainBase.devType" />
                <i-col span="11">
                    <Form-item label="设备类型" prop="type">
                        <i-input type="text" v-model="devMainBase.devTypeName" icon="md-arrow-dropdown-circle"
                                 @on-click="devTypeShow" placeholder="设备类型"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="生产时间(分钟)" prop="checkDatePrud">
                        <i-input v-model="devMainBase.checkDatePrud" placeholder="生产时间"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="非生产时间(分钟)" prop="checkDateUprud">
                        <i-input v-model="devMainBase.checkDateUprud" placeholder="非生产时间"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="检测工具" prop="checkTool">
                        <i-input v-model="devMainBase.checkTool" placeholder="检测工具"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="方法手段" prop="methodType">
                        <i-input v-model="devMainBase.methodType"  placeholder="方法手段"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="维护内容" prop="checkContent">
                        <i-input v-model="devMainBase.checkContent" type="textarea" placeholder="维护内容"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="维护标准" prop="checkSt">
                        <i-input v-model="devMainBase.checkSt" type="textarea" placeholder="维护标准"></i-input>
                    </Form-item>
                 </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="物料需求" prop="materialRequ">
                        <i-input v-model="devMainBase.materialRequ" type="textarea" placeholder="请输入物料需求"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="选项备注" prop="remark">
                        <i-input v-model="devMainBase.remark" type="textarea" placeholder="选项备注"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <Form-item>
                    <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                    <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
                    <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
                </Form-item>
            </Row>
        </i-form>
	</Card>
</div>
<div id="categoryLayer" style="display: none;padding:10px;">
    <ul id="categoryTree" class="ztree"></ul>
</div>
<script src="${rc.contextPath}/js/device/devmainbase.js?_${date.systemTime}"></script>
</body>
</html>
